﻿Imports DARSClassLibrary
Public Class AdvisorLandingPage
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'Check if user is logged in
        If Session("CurrentUser") Is Nothing Then
            Response.Redirect("NotLoggedIn.aspx")
            Exit Sub
        End If

        'This will grab the name of the current user from the session object and 
        'display it in the label. Commented out for Page testing

        Dim objAdviser As Advisor = CType(Session("CurrentUser"), Advisor)
        lblCurrentUser.Text = objAdviser.FirstName & objAdviser.LastName

    End Sub

    Protected Sub Logout(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLogout.ServerClick
        Session.Abandon()
        Response.Redirect("NotLoggedIn.aspx")
    End Sub

End Class